4 # Copyright (c) 2006 Microsoft Corporation. All rights reserved.
6 # The use and distribution terms for this software are contained in the file
7 # named license.txt, which can be found in the root of this distribution.
8 # By using this software in any fashion, you are agreeing to be bound by the
9 # terms of this license.
11 # You must not remove this notice, or any other, from this software.
15 #########################################################################
19 # -----------------------------------------------------------------------------
21 # ENV_CFLAGS The additional CFLAGS.
23 # MESSAGE_FILE Specifies the name of the text file which stores NMAKE's
26 ###############################################################################
35 ! error INCLUDE environment variable not defined
39 ! error LIB environment variable not defined
64 !if
"$(VER)" != "debug"
65 !if
"$(VER)" != "release"
66 !error VER env var has bad value
'$(VER)', use lower case
'debug/release'
76 !if
("$(NOPCH)" != "1") && ("$(LTCG_BUILD)" != "1")
77 PCH
= -YX
-Fp
$(OBJDIR
)\nmake.pch
80 ###########################################
82 # Version and TARGET dependent macros ... #
84 ###########################################
87 MESSAGE_FILE
= nmmsg.us
97 !if
"$(VER)" == "debug"
103 ##############################
105 # Macro Dependent macros ... #
107 ##############################
109 CFLAGS
= $(CFLAGS
) $(CLM
) /DNO_OPTION_Z
/Fd
$(OBJDIR
)\nmake.pdb
110 CFLAGS
= $(CFLAGS
) /Gf
/Gy
/I
$(LANGAPI
)\
include /nologo
/W3
112 !if
("$(NOPCH)" != "1") && ("$(LTCG_BUILD)" != "1")
113 CFLAGS
= $(CFLAGS
) /Fp
$(OBJDIR
)\nmake.pch
/YXgrammar.h
116 !if
"$(LTCG_BUILD)" == "1"
117 CFLAGS
= $(CFLAGS
) /GL
121 CFLAGS
= $(CFLAGS
) /D_MBCS
122 !message
--- building _MBCS version
125 !if
"$(VER)" == "debug"
127 CFLAGS
= $(CFLAGS
) /Gz
/MDd
/Od
/Zi
129 !else # Release version
131 CFLAGS
= $(CFLAGS
) /Gz
/DNDEBUG
/MD
/O2
/Zi
136 CFLAGS
= $(CFLAGS
) /FR
$(OBJDIR
)^\
139 !if
"$(PROCESSOR_ARCHITECTURE)" == "x86"
140 CFLAGS
= $(CFLAGS
) -DWIN95
143 !if
"$(PROCESSOR_ARCHITECTURE)" == "IA64"
144 CFLAGS
= $(CFLAGS
) -Wp64
148 #############################
150 # Creating Object directory #
152 #############################
154 OBJDIR
= $(VER
)$(_OD_EXT
)
157 !if
[cd
$(VER
)$(_OD_EXT
)]
158 ! if
[md
$(VER
)$(_OD_EXT
)]
159 ! error Failed creating
$(VER
)$(_OD_EXT
) directory
!
160 ! else if
[cd
$(VER
)$(_OD_EXT
)]
161 ! error Failed cd to
$(VER
)$(_OD_EXT
) directory
!
166 ! error Failed cd to
$(MAKEDIR
) directory
!
169 ##############################
171 # Setting up inference rules #
173 ##############################
175 # Clear the Suffix list
183 # The inference rules used are
185 .
cpp{$(OBJDIR
)}.obj
::
186 $(CC
) $(CFLAGS
) /c
/Fo
$(OBJDIR
)/ $<
189 rc
$(RCFLAGS
) -I
$(LANGAPI
)\
include -I
$(OBJDIR
) -Fo
$@
$<
191 ###############################
193 # Echoing useful information #
195 ###############################
199 !message VER
= "$(VER)"
200 !message CC
= "$(CC)"
201 !message LINKER
= "$(LINKER)"
202 !message OBJDIR
= "$(OBJDIR)"
203 !message CFLAGS
= "$(CFLAGS)"
205 !message PATH
= "$(PATH)"
206 !message INCLUDE
= "$(INCLUDE)"
207 !message LIB
= "$(LIB)"
212 #################################
214 # Providing help about building #
216 #################################
218 !if
"$(HELP)" == "build"
221 Define the VER environment variable to tell NMAKE what version to build.
222 The possible values for VER are
'debug' and
'release'.
223 The object files are always built with
/Zi
224 option. This is done to make it just a matter of linking when debugging. The
225 'retail' and
'cvinfo' versions differ in only that codeview information has
226 been added. For the
'retail' version the asserts are removed.
227 To see information about what is being built
define INFO.
228 You can
define LOGO to see the compiler logo and
229 define ECHO to see the command actually passed to the compiler. The switches
230 passed to the compiler can be changed from the command line by defining the
231 corresponding switches used in def.mak.